var chartStore = new Ext.data.Store({
	proxy : new Ext.data.HttpProxy({
				url : 'charts.html',
				method:'post'
			}),
	reader : new Ext.data.JsonReader({
				root : 'chartscomp',
				disableCaching:true,
				autoLoad : true
			}, [{
						name : 'monthName',
						mapping : 'monthName'
					},
					{
						name : 'drug1',
						mapping : 'drug1'
					},
					{
						name : 'drug2',
						mapping : 'drug2'
					}
			])
});



Ext.chart.Chart.CHART_URL = '/gis-addons/scripts/ext-3.4.0/resources/charts.swf';

ChartForm = Ext.extend(Ext.FormPanel, {
	
        width: 700,
        height: 350,
        id:'drugChart',
        //title:'Drug Comparison Chart',
        initComponent : function(config) {
        	Ext.apply(this,{
        		
        items: [
                
           {
        	//title:'Drug Comparison Chart',
            xtype: 'columnchart',
            store: chartStore,
            itemId: 'compareChart',
            xField: 'monthName',
            yAxis: new Ext.chart.NumericAxis({
                    displayName: 'Rentals',
                    labelRenderer : Ext.util.Format.numberRenderer('0,0')
            }),
            
            series: [{
                type: 'column',
                displayName:drug1name ,
                yField: 'drug1'
            }, {
                type: 'column',
                displayName: drug2name,
                yField: 'drug2'
            }],
            extraStyle: {
            		legend: {
            		display: 'bottom'
            		}
            		}
                     
           
            
        }]
    });

       	ChartForm.superclass.initComponent.apply(this, arguments);
}
});







